﻿using Abp.Application.Services.Dto;
using AppFramework;
using AppFramework.Admin.Models;
using AppFramework.DinosaursParkMes.Production;
using AppFramework.DinosaursParkMes.Production.DTO;
using AppFramework.DinosaursParkMes.ProductionReturn;
using AppFramework.DinosaursParkMes.ProductionReturn.DTO;
using AppFramework.Shared;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ViewModels.DinosaursParkMes.ProductionReturn
{
    public class ProductionReturnViewModel : NavigationCurdViewModel
    {
        private readonly IProductionReturninfoAppService appservice;
        private readonly ProductionReturninfoAppService service;
        private readonly ProductionReturnResponseDTO response;
        //public ProductionReturnResponseDTO SelectedItem => Map<ProductionReturnResponseDTO>(dataPager.SelectedItem);

        public ProductionReturnViewModel(IProductionReturninfoAppService appservice , ProductionReturninfoAppService service = null, ProductionReturnResponseDTO response = null)
        {
            this.appservice = appservice;
            this.service = service;
            this.response = response;
            UptStatesCommand = new MyConnand(Tuiliao);
        }
        public MyConnand UptStatesCommand { get; set; }
        private async Task ProductionReturnList()
        {
            await appservice.ProductionReturnList().WebAsync(dataPager.SetList);
        }
        public void Tuiliao()
        {
            MessageBox.Show("111");
            //await SetBusyAsync(async () =>
            //{
            //    //int id = 1021;
            //    await appservice.UptStates(1021);
            //});
        }

        public override async Task OnNavigatedToAsync(NavigationContext navigationContext = null)
        {
            await SetBusyAsync(ProductionReturnList);
        }
    }
}
